﻿using UnityEngine;
using System.Collections;

public class Teleporter : MonoBehaviour 
{
	public Transform destination;
	public GameObject explosion;

	void OnTriggerEnter(Collider collider)
	{
		if(collider.gameObject.CompareTag("Player"))
		{
			collider.transform.position = destination.position;
			Instantiate (explosion, collider.transform.position, Quaternion.identity);
		}
	}
}
